public class Solution2270 {
    public int waysToSplitArray(int[] nums) {
        long sum=0;
        for (int num : nums) {
            sum=sum+num;
        }
        long t=0;
        int ans=0;
        for (int i=0;i<nums.length-1;i++){
            t=t+nums[i];
            if (t*2>=sum){
                ans++;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2270().waysToSplitArray(new int[]{10,4,-8,7}));
    }
}
